<!--
 * @Description: 学生店铺列表
 * @Author: Li Yujie
 * @Date: 2021/04/02
 * @Last Modified by: Li Yujie
 * @Last Modified time: 2021/04/02
-->
<template>
    <div class="wrapper">
        <div class="content-wrapper">
            <!-- 筛选-->
            <div class="filter-view">
                <div class="header-new-box">
                    <p class="header-new-box-title">公司名称</p>
                    <el-input
                        placeholder="请输入店铺名称"
                        v-model="filterData.shop_title"
                        suffix-icon="el-icon-search"
                        clearable
                        size="medium"
                        @keydown.enter.native="getTableData(1)"
                    />
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">手机号</p>
                    <el-input
                        placeholder="请输入手机号"
                        v-model="filterData.phone"
                        suffix-icon="el-icon-search"
                        clearable
                        size="medium"
                        @keydown.enter.native="getTableData(1)"
                    />
                </div>
                <div class="header-new-box">
                    <p class="header-new-box-title">已缴清上月账单</p>
                    <el-select
                        v-model="filterData.student_bill_money_status"
                        filterable
                        placeholder="全部"
                        size="medium"
                        style="width: 152px"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in selectList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                </div>
                <!--<div class="header-new-box">
                    <p class="header-new-box-title">提交时间</p>
                    <el-date-picker
                        v-model="dateTimeRange"
                        type="datetimerange"
                        range-separator="-"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                        :default-time="['00:00:00', '23:59:59']"
                        size="medium"
                        style="width: 400px"
                        value-format="timestamp"
                    />
                </div>-->
                <div class="header-new-box">
                    <el-button
                        type="primary"
                        size="small"
                        @click="getTableData(1)"
                    >
                        查询
                    </el-button>
                </div>
            </div>
            <!--筛选-->

            <!-- table -->
            <el-table
                :data="tableData"
                height="100%"
                style="width: 100%;"
                ref="tempLateName"
                class="data-table"
                v-loading="tableLoading"
                @sort-change="handleSortChanged"
            >
                <el-table-column
                    label="序号"
                    align="center"
                    width="80"
                    type="index"
                />
                <el-table-column
                    label="商家logo"
                    align="center"
                >
                    <template slot-scope="scope">
                        <img
                            src=""
                            class="table-image"
                            alt=""
                            @click="showPreview(scope.row.class_group_images)"
                        >
                    </template>
                </el-table-column>
                <el-table-column
                    prop="shop_title"
                    label="店铺名称"
                    width="140"
                    show-overflow-tooltip
                    align="left"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    prop="shop_no"
                    label="店铺编号"
                    show-overflow-tooltip
                    align="left"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    prop="phone"
                    label="入驻手机号"
                    width="110"
                    show-overflow-tooltip
                    align="center"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    prop="goods_count"
                    label="商品数量"
                    show-overflow-tooltip
                    align="center"
                    :formatter="emptyFormatter"
                />
                <el-table-column
                    prop="need_audit"
                    show-overflow-tooltip
                    label="权限"
                >
                    <template slot-scope="scope">
                        <template v-if="scope.row.shop_type === 3">
                            --
                        </template>
                        <template v-if="scope.row.shop_type !== 3">
                            <template v-if="scope.row.need_audit === 1">需要审核</template>
                            <template v-if="scope.row.need_audit === 0">无需审核</template>
                        </template>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="shop_status_str"
                    align="center"
                    show-overflow-tooltip
                    label="店铺状态"
                />
                <el-table-column
                    prop="shop_status"
                    show-overflow-tooltip
                    width="150px;"
                    label="上架状态"
                >
                    <template slot-scope="scope">
                        <div class="zd-status-wrap">
                            <div v-if="scope.row.shop_status === 1">已上架</div>
                            <div v-if="scope.row.shop_status === 0">已下架</div>
                            <el-switch
                                :active-value="1"
                                :inactive-value="0"
                                style="margin-left: 10px;"
                                v-model="scope.row.shop_status"
                                @change="fnChangeStatus($event, scope.row)"
                            />
                        </div>
                    </template>
                </el-table-column>
                <el-table-column
                    :formatter="emptyFormatter"
                    prop="deposit.vas_money"
                    show-overflow-tooltip
                    label="增值服务费用"
                    :width="140"
                />
                <el-table-column
                    :formatter="emptyFormatter"
                    prop="deposit.vas_remark"
                    show-overflow-tooltip
                    label="增值服务备注"
                    :width="140"
                />
                <el-table-column
                    prop="student_bill_money_this_month_pay"
                    :formatter="emptyFormatter"
                    show-overflow-tooltip
                    label="上月账单金额"
                    sortable
                    :width="130"
                />
                <el-table-column
                    prop="student_bill_money_status"
                    :formatter="emptyFormatter"
                    show-overflow-tooltip
                    label="已缴清上月账单"
                    :width="130"
                >
                    <template slot-scope="scope">
                        <p v-if="scope.row.student_bill_money_status === 1">是</p>
                        <p v-else-if="scope.row.student_bill_money_status === 0">否</p>
                        <p v-else>--</p>
                    </template>
                </el-table-column>
                <el-table-column
                    :formatter="emptyFormatter"
                    prop="deposit.deposit_money"
                    :min-width="90"
                    show-overflow-tooltip
                    label="保证金金额"
                />
                <el-table-column
                    :formatter="emptyFormatter"
                    prop="deposit.deposit_time"
                    :min-width="90"
                    show-overflow-tooltip
                    label="可提现时间"
                >
                    <template slot-scope="scope">
                        {{ scope.row.deposit_time * 1000 | dateFormatter('yyyy/MM/dd HH:mm') }}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="create_time"
                    width="140"
                    label="创建时间"
                >
                    <template slot-scope="scope">
                        <template v-if="scope.row.shop_type == 3">
                            --
                        </template>
                        <template v-if="scope.row.shop_type != 3">
                            <template v-if="scope.row.create_time">{{ scope.row.create_time*1000 | dateFormatter('yyyy/MM/dd HH:mm') }}</template>
                        </template>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="create_time"
                    width="140"
                    label="关店时间"
                    align="center"
                >
                    <template slot-scope="scope">
                        <template v-if="scope.row.shop_type == 3">
                            --
                        </template>
                        <template v-if="scope.row.shop_type != 3">
                            <template v-if="scope.row.close_time && scope.row.shop_status === 0">{{ scope.row.close_time*1000 | dateFormatter('yyyy/MM/dd HH:mm') }}</template>
                            <template v-else>--</template>
                        </template>
                    </template>
                </el-table-column>
                <el-table-column
                    label="备注"
                    prop="remark"
                    :formatter="emptyFormatter"
                    width="140"
                    align="center"
                />
                <el-table-column
                    label="操作"
                    align="left"
                    width="260"
                    fixed="right"
                >
                    <template slot-scope="scope">
                        <div class="option-btn-group">
                            <el-button
                                type="text"
                                class="el-goodlist-text"
                                @click="handleRoute('GoodsList', {shop_title: scope.row.shop_title})"
                            >
                                查看商品
                            </el-button>
                            <el-button
                                type="text"
                                @click="fnSetShopAuth(scope.row)"
                            >
                                设置权限
                            </el-button>
                            <el-button
                                type="text"
                                @click="fnWithods(scope.row)"
                            >
                                保证金充值
                            </el-button>
                            <el-button
                                type="text"
                                @click="fnSetShopStatus(scope.row.shop_no, scope.row.shop_status ? 0 : 1)"
                            >
                                {{ scope.row.shop_status ? '禁用' : '解禁' }}
                            </el-button>
                            <el-button
                                type="text"
                                @click="showRemarkDialog(scope.row)"
                            >
                                填写备注
                            </el-button>
                            <el-button
                                type="text"
                                @click="fnSetprice(scope.row)"
                            >
                                设置保证金
                            </el-button>
                        </div>
                    </template>
                </el-table-column>
            </el-table>
            <!-- /table -->

            <!-- /分页 -->
            <div class="pagination-wrapper clearfix">
                <el-pagination
                    layout="total, prev, pager, next, jumper"
                    background
                    :current-page.sync="page.now_page"
                    :total="page.total_count"
                    :page-size="page.page_size"
                    @current-change="getTableData"
                />
            </div>
        </div>
        <!-- 备注弹窗 -->
        <reject-dialog
            ref="remarkDialog"
            title="填写备注"
            placeholder="请输入备注信息"
            :visible.sync="remarkDialog"
            :maxlength="100"
            @confirm="handleChangeRemark(shop_no, $event)"
        />
        <!-- 设置权限弹窗 -->
        <el-dialog
            title="提示"
            :visible.sync="centerDialogVisible"
            width="30%"
            custom-class="auth-dialog"
            center>
            <div class="dialog-auth">
                <div class="auth-title">该商家提交商品是否需要审核？</div>
                <div class="radio-wrap-dialog">
                    <el-radio-group v-model="authValue">
                        <el-radio :label="1">需要审核</el-radio>
                        <el-radio :label="0">无需审核</el-radio>
                    </el-radio-group>
                </div>
            </div>
            <span
                slot="footer"
                class="dialog-footer">
                <el-button
                    size="medium"
                    style="width: 120px;"
                    @click="centerDialogVisible = false"
                >
                    取 消
                </el-button>
                <el-button
                    type="primary"
                    size="medium"
                    style="width: 120px;"
                    @click="fnConfirmSetShopAuth">确 定</el-button>
            </span>
        </el-dialog>
        <!-- 设置保证金 -->
        <el-dialog
            title="选择保证金"
            :visible.sync="dialogVisibleBood"
            width="400px"
            :close-on-click-modal="true"
            center
        >
            <div class="zd-select-bood">
                <el-radio
                    v-model="bood"
                    :label="item.level_no"
                    v-for="(item,index) in boodList"
                    :key="index"
                    class="zd-select-radio"
                >
                    <div class="zd-bood-wrap">
                        <img
                            :src="item.level_logo"
                            class="zd-bood-image"
                        >
                        <p>{{ item.level_money }}元</p>
                    </div>
                </el-radio>
            </div>
            <span
                slot="footer"
                class="dialog-footer"
            >
                <el-button
                    type="primary"
                    size="small"
                    @click="fnConfirmbood()"
                >
                    确 定
                </el-button>
            </span>
        </el-dialog>

        <!-- 保证金充值 -->
        <el-dialog
            title="充值保证金"
            :visible.sync="dialogDeposit"
            width="680px"
            :close-on-click-modal="true"
        >
            <el-form
                :model="ruleFormDep"
                ref="ruleFormDep"
                label-width="10px"
                class="demo-ruleForm"
            >
                <el-form-item>
                    <div class="zd-wrap">
                        <el-radio
                            v-model="ruleFormDep.selectTime"
                            label="1"
                        >
                            快速设置时间
                        </el-radio>
                        <el-select
                            v-model="ruleFormDep.fast_time"
                            placeholder="保证金提现时限"
                            size="small"
                            :style="{pointerEvents: ruleFormDep.selectTime == '2' ? 'none' : '', opacity: ruleFormDep.selectTime == '2' ? '0.5' : '',width: '400px'}"
                        >
                            <el-option
                                v-for="item in dateList"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"/>
                        </el-select>
                    </div>
                </el-form-item>
                <el-form-item>
                    <div class="zd-wrap">
                        <el-radio
                            v-model="ruleFormDep.selectTime"
                            label="2"
                        >
                            手动设置时间
                        </el-radio>
                        <el-date-picker
                            v-model="ruleFormDep.expres_time"
                            type="datetime"
                            placeholder="设置具体可提现时间"
                            align="right"
                            size="small"
                            :style="{pointerEvents: ruleFormDep.selectTime == '1' ? 'none' : '', opacity: ruleFormDep.selectTime == '1' ? '0.5' : '',width: '400px'}"
                        />
                        <!-- :picker-options="pickerOptions" -->
                    </div>
                </el-form-item>
                <el-form-item
                    label="保证金金额"
                    label-width="120px"
                >
                    <el-input-number
                        v-model="ruleFormDep.money"
                        size="small"
                        style="margin-left: 31px"
                        :min="0"
                        :controls="false"
                        :step="1"
                        :precision="2"
                        :step-strictly="true"/>
                    <span>元</span>
                    <p style="font-size:12px;margin-left: 31px;color:#333">* 该金额在设置时间到期后可提现，请核实实际款项后慎重填写</p>
                </el-form-item>
                <el-form-item
                    label="增值服务费"
                    label-width="120px"
                >
                    <el-input-number
                        v-model="ruleFormDep.vas_money"
                        size="small"
                        style="margin-left: 31px"
                        :min="0"
                        :controls="false"
                        :step="1"
                        :precision="2"
                        :step-strictly="true"/>
                    <span>元</span>
                </el-form-item>
                <el-form-item
                    label="增值服务备注"
                    label-width="120px"
                >
                    <el-input
                        v-model="ruleFormDep.vas_remark"
                        type="textarea"
                        placeholder="请填写增值服务备注"
                        :autosize="{ minRows: 2, maxRows: 6 }"
                        style="width: 400px; margin-left: 31px"
                    />
                </el-form-item>
                <el-form-item>
                    <div style="display:flex;justify-content: center;width:100%;margin-top: 24px">
                        <el-button
                            size="medium"
                            style="width:100px"
                            @click="dialogDeposit = false"
                        >
                            取消
                        </el-button>
                        <el-button
                            type="primary"
                            size="medium"
                            style="width:100px;margin-left:80px !important"
                            @click="fnSetDepost()"
                        >
                            确定
                        </el-button>
                    </div>
                </el-form-item>
            </el-form>
        </el-dialog>
        <!-- 图片预览 -->
        <el-image-viewer
            class="el-image-viewer--verify"
            v-if="showViewer"
            :url-list="previewImages"
            :initial-index="initialIndex"
            :mask-closable="false"
            :append-to-body="false"
            :on-close="() => { showViewer = false }"
        />
    </div>
</template>

<script>
import {back} from '@/mixin/back';
import ImgPreview from "@/components/common/img-preview";
import RejectDialog from "@/components/dialog/reject-dialog";
import ElImageViewer from 'element-ui/packages/image/src/image-viewer';

export default {
    name: 'StudentShopList',
    mixins: [back],
    components: {
        RejectDialog,
        ImgPreview,
        ElImageViewer
    },
    data() {
        return {
            filterData: {
                shop_type: 1,
                // 店铺名称
                shop_title: '',
                // 手机号
                phone: '',
                // 是否已缴清
                student_bill_money_status: 99,
                sort_field: '',
                sort_type: '',
            },
            tableData: [],
            tableLoading: false,
            page: {
                now_page: 1,
                total_count: 0,
                page_size: 20
            },
            dateTimeRange: [],
            // 是否已缴清
            selectList: [
                {label: '全部', value: 99},
                {label: '是', value: 1},
                {label: '否', value: 0},
            ],
            remarkDialog: false,
            // element图片预览
            previewImages: [],
            showViewer: false,
            initialIndex: 0,
            // 设置权限
            shop_no: '',
            authValue: 0,
            centerDialogVisible: false,
            // 保证金充值
            dialogDeposit: false,
            dialogVisibleBood: false,
            // 保证金
            bood: '',
            boodList: [],
            dateList: [],
            // 充值保证金
            ruleFormDep: {
                selectTime: '2',
                fast_time: '',
                expres_time: '',
                money: 0,
                vas_remark: '',
                vas_money: 0
            },
        };
    },
    computed: {},
    watch: {
        dateTimeRange(value) {
            this.filterData.start_time = value ? value[0] / 1000 : '';
            this.filterData.end_time = value ? value[1] / 1000 : '';
            this.getTableData(1);
        }
    },
    filters: {
        statusName(val) {
            switch (val) {
                case 0:
                    return '待审核';
                case 1:
                    return '通过';
                case -1:
                    return '不通过';
                default:
                    return '--';
            }
        },
    },

    mounted() {
        this.authResult = this.$route.meta.authResult;
        this.dateList = [{
            value: this.setTemp(new Date(), 6),
            label: '6个月'
        },{
            value: this.setTemp(new Date(), 12),
            label: '12个月'
        },{
            value: this.setTemp(new Date(), 24),
            label: '24个月'
        },{
            value: this.setTemp(new Date(), 36),
            label: '36个月'
        }];
        this.getBoodList();
        this.getTableData();
    },

    methods: {

        /**
         * @description 获取列表数据
         * @param page
         */
        getTableData(page) {

            this.tableLoading = true;
            let params = {...this.filterData};

            params.page_id = page || this.page.now_page;
            this.$post('/student/shop%5Cget_list', params, res => {
                if (res.code === 1) {
                    this.tableData = res.data.list;
                    this.page = res.data.page;
                } else {
                    this.$notify({
                        title: '提示',
                        message: res.msg,
                        type: 'warning'
                    });
                }
                this.tableLoading = false;
            });
        },

        /**
         * 获取n月后的当天时间戳
         * @param  {Number}    temp      //时间戳
         * @param  {Number}    param     //第n月
         */
        setTemp (temp, param) {
            let year = new Date(temp).getFullYear(),
                month = new Date(temp).getMonth() + 1,
                day = new Date(temp).getDate();

            month = Number(month) + Number(param);

            if(month < 10) {
                month = '0' + month;
            } else if (month > 10 && month <= 12) {
                //
            } else if (month > 12) {
                year = Number(year) + parseInt(month / 13);
                month = month - 12 * Math.floor( Number(month) / 12) == 0 ? 12 : month - 12 * Math.floor( Number(month) / 12);
            }

            day = day < 10 ? '0' + day : day;

            return new Date(year + '-' + month + '-' + day).getTime();
        },

        /**
         * @description 上下架
         */
        fnChangeStatus(value, row) {
            this.$post('/student/shop%5Cset_status', {
                shop_no: row.shop_no,
                shop_status: value ? 1 : 0
            }, resp => {
                if (resp.code === 1) {
                    this.$notify({
                        type: 'success',
                        title: '提示',
                        message: '操作成功',
                    });
                    this.getTableData();
                }else{
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                        center: true
                    });
                }
            });
        },

        /**
         * @description 过滤函数
         */
        emptyFormatter(row, column, val) {
            if (!val) return '--';
            return val;
        },

        /**
         * 预览图片
         * @param   {String}    images      //单图预览
         * @param   {Array}     images      //多图预览
         * @param index
         */
        showPreview(images, index = 0) {
            this.previewImages = images;
            this.initialIndex = index;
            this.showViewer = true;
        },

        /**
         * 排序
         */
        handleSortChanged(data) {
            let sortTypeMap = {
                ascending: 0,
                descending: 1
            };

            let sortFieldMap = {
                create_time: 0,
                login_count: 1,
                login_time: 2,
                student_bill_money_this_month_pay: 3
            };

            if (data.order) {
                this.filterData.sort_field = sortFieldMap[data.prop];
                this.filterData.sort_type = sortTypeMap[data.order];
            } else {
                this.filterData.sort_field = '';
                this.filterData.sort_type = '';
            }

            this.getTableData();
        },

        /**
         * 路由跳转
         * @param routeName
         * @param query
         */
        handleRoute(routeName, query) {
            this.$router.push({
                name: routeName,
                query
            });
        },

        /**
         * 显示设置权限
         * @param row
         */
        fnSetShopAuth(row) {
            this.shop_no = row.shop_no;
            this.authValue = row.need_audit;
            this.centerDialogVisible = true;
        },

        /**
         * 设置权限
         */
        fnConfirmSetShopAuth() {
            this.$post('/student/shop%5Cmodify', {
                shop_no: this.shop_no,
                need_audit: this.authValue
            }, resp => {
                if (resp.code === 1) {
                    this.centerDialogVisible = false;
                    this.getTableData();
                    this.$message({
                        type: 'success',
                        message: '操作成功',
                        center: true
                    });
                }else{
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                        center: true
                    });
                }
            });
        },

        /**
         * 禁用/解禁
         * @param shop_no
         * @param status
         */
        fnSetShopStatus(shop_no, status) {
            this.$confirm(`是否确定${status ? '解禁' : '禁用' }?`, '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$post('/wei4/hire_user%5Cset_status', {
                    shop_no: shop_no,
                    status: status
                }, resp => {
                    if (resp.code === 1) {
                        this.$notify({
                            type: 'success',
                            message: '操作成功',
                            title: '提示'
                        });
                        this.getTableData();
                    } else {
                        this.$notify({
                            type: 'warning',
                            message: resp.msg,
                            title: '提示'
                        });
                    }
                });
            }).catch(() => {});
        },

        /**
         * 显示备注弹窗
         * @param row
         */
        showRemarkDialog(row) {
            this.shop_no = row.shop_no;
            this.remarkDialog = true;
        },

        /**
         * 备注
         * @param shop_no
         * @param remark
         */
        handleChangeRemark(shop_no, remark) {
            this.$post('/wei4/hire_user%5Cremark', {
                shop_no,
                remark
            }, resp => {
                if (resp.code === 1) {
                    this.getTableData();
                    this.$notify({
                        type: 'success',
                        message: '操作成功',
                        title: '提示'
                    });
                } else {
                    this.$notify({
                        type: 'warning',
                        message: resp.msg,
                        title: '提示'
                    });
                }
            });
        },

        /**
         * 设置保证金
         * @param row
         */
        fnSetprice (row) {
            this.bood = row.level_no;
            this.shop_no = row.shop_no;
            this.dialogVisibleBood = true;
        },

        /**
         * 获取保证金数据
         */
        getBoodList () {
            this.$post('/student/hire_level%5Cget_list',{},resp => {
                if(resp.code === 1) {
                    this.boodList = resp.data.list;
                } else {
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                    });
                }
            });
        },

        /**
         * 确定选择保证金
         */
        fnConfirmbood () {
            if(this.bood === '') {
                this.$message({
                    type: 'warning',
                    message: '请先选择保证金,不可以为空',
                    center: true
                });
                return;
            }

            this.$post('/student/shop%5Cset_level',{
                shop_no: this.shop_no,
                level_no: this.bood
            },resp => {
                if (resp.code === 1) {
                    this.dialogVisibleBood = !this.dialogVisibleBood;
                    this.$message({
                        type: 'success',
                        message: '操作成功',
                        center: true
                    });
                    this.getTableData();
                } else {
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                        center: true
                    });
                }
            });
        },

        /**
         * 获取保证金充值
         * @param row
         */
        fnWithods (row) {
            this.shop_no = row.shop_no;
            this.ruleFormDep = {
                selectTime: '2',
                fast_time: '',
                expres_time: row.deposit_time === 0 ? '' : row.deposit_time * 1000,
                money: row.deposit_money === 0 ? '' : row.deposit_money,
                vas_remark: '',
                vas_money: row.vas_money
            };
            this.dialogDeposit = !this.dialogDeposit;
        },

        /**
         * 确定充值保证金
         */
        fnSetDepost () {
            if(Number(this.ruleFormDep.money) < 0) {
                this.$message({
                    type: 'message',
                    message: '保证金金额不可以小于0',
                    center: true
                });
                return;
            }

            let time = this.ruleFormDep.selectTime == '1' ? this.ruleFormDep.fast_time : this.ruleFormDep.expres_time;

            this.$post('/student/hire_user%5Cset_deposit',{
                shop_no: this.shop_no,
                deposit_time: new Date(time).getTime() / 1000,
                deposit_money: this.ruleFormDep.money,
                vas_remark: this.ruleFormDep.vas_remark,
                vas_money: this.ruleFormDep.vas_money
            },resp => {
                if (resp.code == 1) {
                    this.dialogDeposit = !this.dialogDeposit;
                    this.$message({
                        type: 'success',
                        message: '操作成功',
                        center: true
                    });
                    this.getTableData();
                } else {
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                        center: true
                    });
                }
            });

        },
    }
};
</script>

<style lang="less" scoped>
.wrapper {
    width: 100%;
    flex: 1;

    .content-wrapper {
        display: flex;
        height: calc(100% - 24px);
        flex-direction: column;
        position: relative;
        background: #fff;
        padding: 0 24px;
        box-sizing: border-box;

        /*header*/

        .header {
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #F0F2F5;

            .header-title {
                color: #333333;
                font-size: 20px;
                height: 20px;
                font-weight: 500;
                position: relative;
                margin-left: 12px;
                margin-bottom: 24px;

                &::before {
                    content: '';
                    position: absolute;
                    left: -8px;
                    top: -1px;
                    width: 3px;
                    height: 20px;
                    background: #1890FF;
                }
            }
        }

        /*筛选*/

        .filter-view {
            margin-top: 12px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            flex-wrap: wrap;

            .header-new-box {
                display: flex;
                align-items: center;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #333333;
                white-space: nowrap;
                margin-right: 24px;
                margin-bottom: 12px;

                &-title {
                    margin-right: 16px;
                    white-space: nowrap;
                }
            }
        }

        // 表格
        .data-table {
            ::-webkit-scrollbar {
                width: 6px;
                height: 6px;
            }
            .zd-status-wrap {
                position: relative;
                display: flex;
                align-items: center;
            }

            // 操作按钮
            .option-btn-group {
                .el-button {
                    margin-left: 0;
                    margin-right: 10px;
                }
            }
            .status-wrapper {
                display: flex;
                align-items: center;

                .status-dot {
                    width: 6px;
                    height: 6px;
                    border-radius: 50%;
                    margin-right: 5px;

                    &.success {
                        background: #4CD964;
                    }

                    &.danger {
                        background: #FF3030;
                    }

                    &.warning {
                        background: #FFA72D;
                    }

                    &.normal {
                        background: #C2C2C2;
                    }
                }
            }
        }

        .table-image {
            width: 57px;
            height: 57px;
            cursor: pointer;
        }

        /* 分页 */

        .pagination-wrapper {
            padding-top: 10px;

            .el-pagination {
                float: right;
                padding: 0;
                background-color: transparent;
            }
        }
    }

    // 设置保证金
    .zd-select-bood {
        &::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        display: flex;
        flex-direction: column;
        align-items: center;
        max-height: 300px;
        overflow: auto;
        .zd-select-radio {
            display: flex;
            margin: 20px 0 0 0;
            min-width: 120px;
            .zd-bood-wrap {
                display: flex;
                align-items: center;
                .zd-bood-image {
                    width: 15px;
                    height: 15px;
                    margin-right: 8px;
                    margin-left: 6px;
                    border-radius: 50%;
                }
            }
        }
    }

    .zd-wrap {
        width: 100%;
        height: 32px;
        display: flex;
        align-items: center;
    }
    .zd-shop {
        height: 32px;
        display: flex;
        margin-bottom: 30px;
        align-items: center;
        &-title {
            margin-right: 10px;
            white-space: nowrap;
        }
    }
    .zd-shop-button {
        margin-left: 50%;
        transform: translateX(-50%);
    }

    /deep/ .el-dialog__header {
        padding-top: 10px;
        box-shadow: 0 1px 0 0 rgba(233, 233, 233, 1);
        display: flex;
        align-items: center;
        background: #FAFAFA;
        border-radius: 4px 4px 0 0;

        .el-dialog__title {
            font-weight: 500;
            color: #333;
            font-size: 14px;
        }

        .el-icon-close:before {
            color: rgb(194, 194, 194);
            font-size: 17px;
            font-weight: bold;
        }

        .el-dialog__headerbtn {
            top: 14px;
        }
    }

    /deep/ .el-textarea__inner {
        resize: none;
    }
}
</style>

<style>
.el-image-viewer--verify {
    z-index: 2200!important;
}
</style>
